home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 38 / Amiga Format CD38 (1999-03-15)(Future Publishing)(GB)(Track 1 of 3)[!][issue 1999-04].iso / -in_the_mag- / banging_the_metal / aga.custom.notes < prev    next >
Text File  |  1999-02-10  |  36KB  |  933 lines

  1.             NEW AGA-ECS REGISTERS: (thanx to DDT/HBT for ECS help)
  2.  
  3.     ;CUSTOM = $DFF000
  4.  
  5. vposr    EQU    $004    ; Read vertical most significant bits (and frame flop)
  6.  
  7.     Bit   15 14 13 12 11 10 09 08  07 06 05 04 03  02 01 00
  8.     Use  LOF I6 I5 I4 I3 I2 I1 I0 LOL -- -- -- -- v10 v9 V8
  9.  
  10.     LOF=Long frame(auto toggle control bit in BPLCON0)
  11.     I0-I6 Chip identitication:
  12.     8361 (Regular) or 8370 (Fat) (Agnus-ntsc)=10
  13.     8367 (Pal) or 8371 (Fat-Pal) (Agnus-pal)=00
  14.     8372 (Fat-hr) (agnushr),thru rev4 = 20 Pal,30 NTSC
  15.     8372 (Fat-hr) (agnushr),rev 5 = 22 Pal, 31 NTSC
  16.     8374 (Alice) thru rev 2 = 22 Pal, 32 NTSC
  17.     8374 (Alice) rev 3 thru rev 4 = 23 Pal, 33 NTSC
  18.     LOL = Long line bit. When low, it indicates short raster line.
  19.     v9,10 -- hires chips only (20,30 identifiers)
  20.  
  21.                 *
  22.  
  23. cdang    EQU    $02e    ; Copper control register
  24.      This is a 1-bit register that when set true, allows the copper to
  25.      access the blitter hardware. This bit is cleared by power-on reset,
  26.      so that the copper cannot access the blitter hardware.
  27.  
  28.     01    CDANG      (STD)    Copper danger mode. Allows Copper access to
  29.                 blitter if set ($DFF03E to $DFF07E).
  30.               (ECS)    If clear copper can only access addresses
  31.                 ($DFF03E to $DFF07E).  If set copper can
  32.                 access all chip registers.
  33.  
  34.                 *
  35.  
  36. STREQU        EQU   $038    ;Strobe for horiz sync with VB (vert blank) and EQU
  37. STRVBL        EQU   $038    ;Strobe for horiz sync with VB
  38. STRHOR        EQU   $03C    ;Strobe for horiz sync
  39. STRLONG        EQU   $03E    ;Strobe for identification of long horiz line (228cc)
  40.  
  41. One of the first 3 strobe addresses above, it is placed on the RGA bus during
  42. the first refresh time slot of every other line, to identify lines with long
  43. counts (228- NTSC, HTOTAL+2- VARBEAMEN=1 hires chips only).There are 4 refresh
  44. time slots and any not used for strobes will leave a null (1FE) address on the
  45. RGA bus.
  46.  
  47.                 *
  48.  
  49. pad2d       EQU   $05A        ; note: byte access only
  50.                 ; function unknown
  51.  
  52.                 *
  53.  
  54. bltcon0l    EQU   $05B        ; note: byte access only - write only
  55.                 ; Blitter control 0, lower 8 bits (minterms)
  56.  
  57. The BLTCON0L register writes the low bits of BLTCON0, thereby expediting
  58. the set up of some blits and generally speeding up the software, since the
  59. upper bits are often the same.
  60.  
  61.                 *
  62.  
  63. bltcon1     EQU   $042          ; Blitter control register 1
  64.  
  65.  
  66. Bit 7 (DOFF) of the BLTCON1 register, when set, disables the output of the
  67. Blitter hardware on channel D.
  68.  
  69. This allows inputs to channels A, B and C and certain address modification
  70. if necessary, without the Blitter outputting over channel D.
  71.  
  72.                 *
  73.  
  74. bltsizv     EQU   $05C        ; Blitter Size Vertical
  75.      0 H14 H13 H12 H11 H10  H9  H8  H7  H6  H5  H4  H3  H2  H1  H0
  76.     H=Height (32768 lines Max)
  77.  
  78.                 *
  79.  
  80. bltsizh     EQU   $05E
  81.                 ; Blitter Size Horizontal
  82.      0   0   0   0   0 W10  W9  W8  W7  W6  W5  W4  W3  W2  W1  W0
  83.     W=Width in words (2048 words = 32768 pixels Max)
  84.     Writing this register starts the Blitter
  85.  
  86. With these two registers, blits up to 32K by 32K are now possible - much
  87. larger than the original chip set could accept. The original commands are
  88. retained for compatibility.  BLTSIZV should be written first, followed by
  89. BLTSIZH, which starts the blitter.
  90.  
  91.                 *
  92.  
  93. pad34        EQU      $068-$06a-$06c-$06e    ;UNUSED
  94.  
  95.                 *
  96.  
  97. pad3b        EQU      $076        ;UNUSED
  98.  
  99.                 *
  100.  
  101. BPLHDAT     EQU   $07A       ;Ext logic UHRES bit plane identifier
  102.  
  103.                 *
  104.  
  105. SPRHDAT        EQU   $078     ;Ext logic UltraHiRes sprite pointer and data identif.
  106.  
  107. This identifies the cycle when this pointer address is on  the bus accessing
  108. the memory.
  109.  
  110.                 *
  111.  
  112. deniseid    EQU   $07C    ; (or Lisaid) Denise chip ID (to check the chipset)
  113.  
  114. Lower 8 bits:    - Random value if standard Denise is present
  115.          - $FC if ECS Denise is present
  116.          - $F8 if AGA chipset is present
  117.  
  118. The original Denise (8362) does not have this register, so whatever value is
  119. left over on the bus from the last cycle will be there. ECS Denise (8373)
  120. returns hex (fc) in the lower 8 bits.Lisa returns hex (f8). The upper 8 bits
  121. of this register are loaded from the serial mouse bus, and are reserved for
  122. future hardware implentation.
  123.  
  124.     The 8 low-order bits are encoded as follows:    (from C-18 AGA doc)
  125.  
  126.     BIT#  Description
  127.     ----  --------------------------------------------------
  128.      7-4  Lisa/Denise/ECS Denise Revision level(decrement to
  129.           bump revision level, hex F represents 0th rev. level).
  130.        3  Maintain as a 1 for future generation
  131.        2  When low indicates AA feature set (LISA)
  132.        1  When low indicates ECS feature set (LISA or ECS DENISE)
  133.        0  Maintain as a 1 for future generation
  134.  
  135.                 *
  136.  
  137. bplcon0     EQU   $100    ; 15 = HIRES
  138.             ; 14 = BPU2 \
  139.             ; 13 = BPU1  |select num of bitplanes, from 0 thru 7
  140.             ; 12 = BPU0 /
  141.             ; 11 = HAM - old HAM, and HAM8 AGA (if bit 4 is set)
  142.             ; 10 = DBLPF - double playfield
  143.             ; 9  = COLOR - Composite video (Genlock)
  144.             ; 8  = GAUD  - Composite audio
  145.             ; 7  = UHRES - 1024*1024 (set also bit 9 in DMACON)
  146.             ; 6  = superhires 1280x 35ns
  147.             ; 5  = BPLHWRM - screen black and white, no copcolors
  148.                     ;BYPASS = 0
  149.             ; 4  = 8 planes (then bits 12-14 must be 0)
  150.             ; 3  = LPEN - Light pen
  151.             ; 2  = LACE - Interlace mode
  152.             ; 1  = ERSY - External resync
  153.             ; 0  = ECSENA Enable bplcon3 register (ECS-AGA)
  154.  
  155. bit 7 of $dff100 is the UHRES bit  (ultra hires is think)...i don't know
  156. how this works exactly but my suspicions is that it is 1024*1024 and i
  157. only 1 bitplane deep... the bitplane pointer for UHRES is $dff1ec and
  158. $dff1ee!!!! so its a new bitplanepointer!!!! it only works in vram (what
  159. the hell is that anyway??)  you have also a vram spritepointer extra...
  160. (also uhres!!)..(also needs bits in DMACON).
  161. Disables hard stops for vert, horiz display windows
  162.  
  163. BYPASS = Bitplanes are scrolled and prioritized normally, but bypass color
  164. table and 8 bit wide data appear on R(7:0).
  165.  
  166. RST_pin resets all bits in all registers new to AA. These registers include:
  167. BPLCON3, BPLCON4, CLXCON2, DIWHIGH, FMODE.
  168.  
  169. ECSENA bit (formerly ENBPLCN3) is used to disable those register bits in
  170. BPLCON3 that are never accessed by old copper lists, and in addition are
  171. required by old-style copper lists to be in their default settings.
  172. Specifically, ECSENA forces the following bits to their default low settings:
  173. BRDRBLNK, BRDNTRAN, ZDCLKEN, EXTBLKEN, and BRDRSPRT. When ECSENA is set high
  174. again, the former settings for these bits are restored.
  175.  
  176. CLXCON2 is reset by a write to CLXCON, so that old game programs will be
  177. able to correctly detect collisions.
  178.  
  179.                 *
  180.  
  181. bplcon1     EQU   $102        ; bits 8 to 14 used for 1/4 pixel scroll
  182.                 ; 2 bits are for displacing the pixels in
  183.                 ; steps of 1/4 for the odd planes and 2 for
  184.                 ; the even planes. the other 2 pairs of bits
  185.                 ; are for scrolling in steps of 16 pixels a
  186.                 ; time (one pair for odd planes and one pair
  187.                 ; for even). This means that you can move any
  188.                 ; playfield 64 pixels to any side with
  189.                 ; intervals of 1/4 pixel!!!
  190.                 ; you have 256 possible scrollvalues=8bits...
  191.  
  192.     15    PF2H7 - 64 PIXEL SCROLL PF2 (AGA)
  193.     14     PF2H6 - 64 PIXEL SCROLL PF2 (AGA)
  194.     13     PF2H1 - FINE SCROLL PF2 (AGA SCROLL 35ns 1/4 of pixel)
  195.     12     PF2H0 - FINE SCROLL PF2
  196.     11     PF1H7 - 64 PIXEL SCROLL PF1 (AGA)
  197.     10     PF1H6 - 64 PIXEL SCROLL PF1 (AGA)
  198.     09     PF1H1 - FINE SCROLL PF1 (AGA SCROLL 35ns 1/4 of pixel)
  199.     08    PF1H0 - FINE SCROLL PF1
  200.     07    PF2H3
  201.     06    PF2H2
  202.     05    PF2H1
  203.     04    PF2H0
  204.     03    PF1H3
  205.     02    PF1H2
  206.     01    PF1H1
  207.     00    PF1H0
  208.  
  209.     PF2H=Playfield 2 scroll code    PFlH=Playfield 1 scroll code
  210.  
  211.     PF2Hx = Playfield 2 horizontal scroll code, x=0-7
  212.  
  213. PF1Hx = Playfield 1 horizontal scroll code, x=0-7 where PFyH0=LSB=35ns
  214. SHRES pixel (bits have been renamed, old PFyH0 now PFyH2, ect). Now that the
  215. scroll range has been quadrupled to allow for wider (32 or 64 bits) bitplanes.
  216.  
  217. - Smooth Hardware Scrolling (from howtocode 6)
  218.  
  219. Extra bits have been added to BPLCON1 to allow smoother hardware
  220. scrolling and scrolling over a larger area.
  221.  
  222. Bits 8 (PF1H0) and 9 (PF1H1) are the new hi-resolution scroll bits for
  223. playfield 0 and bits 12 (PF2H0) and 13 (PF2H1) are the new bits for
  224. playfield 1.
  225.  
  226. Another two bits have been added for each bitplane at bits 10 (PF1H6)
  227. and 11 (PF1H7) for playfield 1 and bits 14 (PF2H6) and 15 (PF2H7) to
  228. increase the maximum scroll range from 16 lo-res pixels to 64 lo-res
  229. pixels (or 256 superhires pixels).
  230.  
  231. Normal 0-16 positions therefore are normal, but it you want to
  232. position your screen at a (super) hires position you need to set
  233. the new bits, or if you require smooth hardware scrolling with either
  234. 2x or 4x  Fetch Mode.
  235.  
  236.                 *
  237.  
  238. bplcon2     EQU   $104 ; Bit Plane Control Register 2 (video priority control)
  239.     15    -
  240.     14 ECS    ZDBPSEL2    \  Select one of the 8 BitPlanes
  241.     13 ECS    ZDBPSEL1     } in ZDBPEN genlock mod
  242.     12 ECS    ZDBPSEL0    /
  243.     11 ECS    ZDBPEN        Use BITPLANEKEY - use bitplane as genlock bits
  244.     10 ECS    ZDCTEN        Use COLORKEY - colormapped genlock bit
  245.     09 ECS    KILLEHB        Kill ExtraHalfBrite (for a normal 6bpl pic)
  246.     08 AGA  RDRAM        All color tabs are reads
  247.     07 AGA  SOGEN (ZDCLKEN)    Enable 14Mhz clock
  248.     06    PF2PRI        PField 2 priority over PField 1
  249.     05    PF2P2        \
  250.     04    PF2P1         } PField 2 sprite priority
  251.     03    PF2P0        /
  252.     02    PF1P2        \
  253.     01    PF1P1          } PField 1 sprite priority
  254.     00    PF1P0        /
  255.  
  256. Using 64-colour mode (NOT extra halfbrite) requires setting the
  257. KILLEHB (bit 9) in BPLCON2.
  258.  
  259. ZDBPSELx =3 bit field which selects which bitplane is to be used for ZD when
  260. ZDBBPEN is set;000 selects BB1 and 111 selects BP8.
  261.  
  262. ZDBPEN = Causes ZD pin to mirror bitplane selected by ZDBPSELx bits. This does
  263. not disable the ZD mode defined by ZDCTEN, but rather is "ored" with it.
  264.  
  265. ZDCTEN = Causes ZD pin to mirror bit #15 of the active entry in high color
  266. table. When ZDCTEN is reset ZD reverts to mirroring color (0).
  267.  
  268. SOGEN = When set causes SOG output pin to go high
  269.  
  270. RDRAM bit in BPLCON2 causes LISA to interpret all colour table accesses as
  271. reads instead of writing to it.
  272.  
  273. Lots of new genlock features were added to ECS denise and are carried over
  274. to LISA. ZDBPEN in BPLCON2 allows any bitplane, delected by ZDBPSEL2,1,0,
  275. to be used as a tansparency mask (ZD pin mirrors contents of selected
  276. bitplane). ZDCTEN disables the old COLOUR00 is transparent mode, and allows
  277. the bit-31 position of each colour in the colour table to control transparency
  278. . ZDCLKEN generates a 14MHz clock synchronized with the video data that can
  279. be used by video post-processors.
  280.  
  281.                 *
  282.  
  283. bplcon3     EQU   $106    ; 0  = EXTBLNKEN - external blank enable
  284.             ; 1  = BRDSPRT - EXTBLKZD - external blank ored
  285.             ;      into trnsprncy- sprites on BORDERS!
  286.             ; 2  = ZDCLKEN - zd pin outputs a 14mhz cloc
  287.             ; 3  = NO FUNCTIONS - SET TO ZERO
  288.             ; 4  = ECS BRDRTRAN Border opaque
  289.             ; 5  = ECS BRDRBLNK Border blank
  290.             ; 6  = AGA SPRES1 \sprite hires,lores,superhires
  291.             ; 7  = AGA SPRES0 /
  292.             ; 8  = NO FUNCTIONS - SET TO ZERO
  293.             ; 9  = LOCT - palette high or low nibble colour
  294.             ; 10 = PF2OF2 \
  295.             ; 11 = PF2OF1  } second playfield's offset in coltab
  296.             ; 12 = PF2OF0 /
  297.             ; 13 = BANK0 \
  298.             ; 14 = BANK1  } LOCT palette select 256
  299.             ; 15 = BANK2 /
  300.             ;
  301.  
  302. BANKx = Selects one of eight color banks, x=0-2.
  303.  
  304. Bits PF2OF2,1,0 in BPLCON3 determine second playfield's offset into the
  305. colour table. This is now necessary since playfields in DPF mode can have
  306. up to 4 bitplanes. Offset values are as defined in register map.
  307. The bits 10 and 11 must be set as default to made the old 16 colours dual
  308. playfiled, so remember that ($106,$c00) (Thanx to MUCSI/Muffbusters)
  309. PF20Fx = Determine bit plane color table offset whe playfield 2 has priority
  310. in dual playfield mode:
  311.  
  312.     PF20F || AFFECTED BITPLANE ||OFFSET    (From C-18 AGA doc)
  313.     -------------------------------------------------------
  314.     | 2 | 1 | 0 || 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 ||(decimal)
  315.     -------------------------------------------------------
  316.     | 0 | 0 | 0 || - | - | - | - | - | - | - | - || none
  317.     | 0 | 0 | 1 || - | - | - | - | - | - | 1 | - || 2
  318.     | 0 | 1 | 0 || - | - | - | - | - | 1 | - | - || 4
  319.     | 0 | 1 | 1 || - | - | - | - | - | 1 | - | - || 8 (default)
  320.     | 1 | 0 | 0 || - | - | - | 1 | - | - | - | - || 16
  321.     | 1 | 0 | 1 || - | - | 1 | - | - | - | - | - || 32
  322.     | 1 | 1 | 0 || - | 1 | - | - | - | - | - | - || 64
  323.     | 1 | 1 | 1 || 1 | - | - | - | - | - | - | - || 128
  324.  
  325. LOCT = Dictates that subsequent color palette values will be written to a
  326. second 12- bit color palette, constituting the RGB low minus order bits.
  327. Writes to the normal hi monus order color palette automattically copied to
  328. the low order for backwards compatibility.
  329. (selects either the 16 MSB or LSB for loading)
  330.  
  331. BRDNTRAN in BPLCON3 generates an opaque border region which can be used to
  332. frame live video. (Genlock)
  333.  
  334. BRDRBLNK = "Border area" is blanked instead of color (0).
  335. Disabled when ECSENA low.
  336.  
  337. BRDRSPRT, when high, allows sprites to be visible out the display window.
  338. but if you want it to work you have to enable ECSENA. This is bit 0 from
  339. $dff100! (this is for compatibilty reasons!)
  340.  
  341. ZDCLKEN = ZD pin outputs a 14MHz clock whose falling edge coincides with hires
  342. (7MHz) video data. this bit when set disables all other ZD functions.
  343. Disabled when ESCENA low.
  344.  
  345. EXTBLKEN = causes BLANK output to be programmable instead of reflecting
  346. internal fixed decodes. Disabled when ESCENA low.
  347.  
  348.                 *
  349.  
  350. bplcon4     EQU   $10C        ; 0  ESPRM7 \
  351.                 ; 1  ESPRM6  \ CHOOSE EVEN SPRITE PALETTE
  352.                 ; 2  ESPRM5  /
  353.                 ; 3  ESPRM4 /
  354.                 ; 4  OSPRM4 \
  355.                 ; 5  OSPRM4  \ CHOOSE ODD SPRITE PALETTE
  356.                 ; 6  OSPRM4  /
  357.                 ; 7  OSPRM4 /
  358.                 ; 8  BPLAM0 \
  359.                 ; 9  BPLAM1  \
  360.                 ; 10 BPLAM2   |
  361.                 ; 11 BPLAM3   | Switch colours without
  362.                 ; 12 BPLAM4   | change the palette
  363.                 ; 13 BPLAM5   |
  364.                 ; 14 BPLAM6  /
  365.                 ; 15 BPLAM7 /
  366.  
  367. BPLAMx = This 8 bit field is XOR`ed with the 8 bit plane color address,thereby
  368. altering the color address sent to the color table (x=1-8)
  369. Bits 15 thru 8 of BPLCON4 comprise an 8-bit mask for the 8 bitplane address,
  370. XOR'ing the individual bits. This allows the copper to exchange colour maps
  371. with a single instruction.
  372.  
  373. ESPRMx = 4 Bit field provides the 4 high order color table address bits for
  374. even sprites: SPR0,SPR2,SPR4,SPR6. Default value is 0001 binary. (x=7-4)
  375.  
  376. OSPRMx = 4 Bit field provides the 4 high order color table address bits for
  377. odd sprites: SPR1,SPR3,SPR5,SPR7. Default value is 0001 binary. (x=7-4)
  378.  
  379.                 *
  380.  
  381. clxcon2     EQU   $10E        ; 0 match value for bitplane 7 collision
  382.                 ; 1 match value for bitplane 8 collision
  383.                 ; 2-5: UNUSED
  384.                 ; 6 ENBP8 enable bitplane 7 (match reqd coll)
  385.                 ; 7 ENBP8 enable bitplane 8 (match reqd coll)
  386.                 ; 8-15: UNUSED
  387.  
  388. A new register CLXCON2 contains 4 new bits. ENBP7 and ENBP6 are the enable
  389. bits for bitplanes 7 and 8, respectively. Similarly, MVBP7 and MVBP8 are
  390. their match value bits. CLXDAT is unchanged.
  391.  
  392.                 *
  393.  
  394. BPL7DAT        EQU   $11c   W     ;Bit plane 7 data (parallel to serial convert)
  395. BPL8DAT     EQU   $11e   W     ;Bit plane 8 data (parallel to serial convert)
  396.  
  397.                 *
  398.  
  399. SPRxPOS    EQU   $140/...    ;Sprite x vert-horiz start position data.
  400.  
  401.     BIT#    SYM        FUNCTION
  402.         ----    ----        -----------------------------------------
  403.     15-08  SV7-SV0      Start vertical value.High bit (SV8) is
  404.                 in SPRxCTL register below.
  405.     07-00  SH10-SH3     Sprite horizontal start value. Low order
  406.                 3 bits are in SPRxCTL register below. If
  407.                 SSCAN2 bit in FMODE is set, then disable
  408.                 SH10 horizontal coincidence detect.This bit
  409.                 is then free to be used by ALICE as an
  410.                 individual scan double enable.
  411.  
  412.                 *
  413.  
  414. sprxctl        EQU   $142/14A/152/15A/162/16A/172/17A
  415.  Sprite x vert stop and control data
  416.  
  417.     BIT#    SYM        FUNCTION
  418.         ----   ----        ----------------------------------------
  419.     15-08    EV7-EV0         End (stop) vert. value. Low 8 bits
  420.     07    ATT        Sprite attach control bit (odd sprites only)
  421.     06 AGA  SV9        Start vert value 10th bit.
  422.     05 AGA  EV9        End (stop) vert. value 10th bit
  423.     04 ECS  SH1=0        Start horiz. value, 70nS increment
  424.     03 AGA  SH0=0        Start horiz. value 35nS increment
  425.     02    SV8        Start vert. value 9th bit
  426.     01    EV8        End (stop) vert. value 9th bit
  427.     00    SH2        Start horiz.value,140nS increment
  428.  
  429.     These 2 registers work together as position, size and
  430.     feature sprite control registers.They are usually loaded
  431.     by the sprite DMA channel, during horizontal blank,
  432.     however they may be loaded by either processor any time.
  433.     Writing to SPRxCTL disables the corresponding sprite.
  434.  
  435.                 *
  436.  
  437. 144/146/14C/14E/154/156/15C/15E/164/166/16C/16E/174/176/17C/17E
  438.  Sprite image Data (From C-18 AGA doc)
  439.  
  440. These registers buffer the sprite image data.They are usually loaded by the
  441. sprite DMA channel but may be loaded by either processor at any time. When a
  442. horizontal coincidence occurs the buffers are dumped into shift registers and
  443. serially outputed to the display, MSB first on the left.
  444. NOTE: Writing to the A buffer enables (arms) the sprite.
  445. Writing to the SPRxCTL registers disables the sprite.
  446. If enabled, data in the A and B buffers will be output whenever the beam
  447. counter equals the sprite horizontal position value in the SPRxPOS register.
  448. In lowres mode, 1 sprite pixel is 1 bitplane pixel wide.In HRES and SHRES
  449. mode, 1 sprite pixel is 2 bitplane pixels.
  450. The DATB bits are the 2SBs (worth 2) for the color registers, and MSB for
  451. SHRES. DATA bits are LSBs of the pixels.
  452.  
  453.                 *
  454.  
  455. COLORxx  180-1BE  W        COLOR table xx    (From C-18 AGA DOC)
  456.  
  457. There 32 of these registers (xx=00-31) and together with the banking bits they
  458. address the 256 locations in the color palette. There are actually two sets of
  459. color regs, selection of which is controlled by the LOCT reg bit.
  460. When LOCT = 0 the 4 MSB of red, green and blue video data are selected along
  461. with the T bit for genlocks the low order set of registers is also selected as
  462. well, so that the 4 bi valuesare automatically extended to 8 bits.
  463. This provides compatibility with old software. If the full range of palette
  464. values are desired, then LOCT can be set high and independant values for the 4
  465. LSB of red, green  and blue can be written. The low order color registers do
  466. not contain a transparency (T) bit.
  467. The table below shows the color register bit usage.
  468.  
  469.     BIT#    15,14,13,12    11,10,09,08    07,06,05,04    03,02,01,00
  470.     ----    -----------    -----------    -----------    -----------
  471.     LOCT=0  T  X  X  X     R7 R6 R5 R4    G7 G6 G5 G4    B7 B6 B5 B4
  472.     LOCT=1  X  X  X  X     R3 R2 R1 R0    G3 G2 G1 G0    B3 B2 B1 B0
  473.  
  474.     T = TRANSPARENCY     R = RED    G = GREEN    B = BLUE    X = UNUSED
  475.  
  476. T bit of COLOR00 thru COLOR31 sets ZD_pin HI, When that color is selected in
  477. all video modes.
  478.  
  479.                 *
  480.  
  481. htotal        EQU   $1c0        ; Highest number count, horiz line
  482.                 ; (VARBEAMEN bit in BEAMCON0 must be set)
  483.  
  484.    HTOTAL    W   A     Highest number count in horizontal line
  485.  
  486.          Bit  15 14 13 12 11 10 09 08 07 06 05 04 03 02 10 00
  487.          Use   0  0  0  0  0  0  0  0 h8 h7 h6 h5 h4 h3 h2 h1
  488.  
  489. Horiz line has theis many + 1 280nS increments. If the pal bit & LOLDIS are
  490. not high, long line/skort line toggle will occur, and there will be this many
  491. +2 every other line. Active if VARBEAMEN=1 or DUAL+1.
  492.  
  493.                 *
  494.  
  495. hsstop        EQU   $1c2        ; Horizontal line position for HSYNC stop
  496.             Sets # of colour clocks for sync stop (HTOTAL for bits)
  497.  
  498.                 *
  499.  
  500. hbstrt        EQU   $1c4        ;  Horizontal line position for HBLANK start
  501. hbstop        EQU   $1c6        ;  Horizontal line position for HBLANK stop
  502.  
  503. Bits 7-0 contain the stop and start positions, respectively, for programed
  504. horizontal blanking in 280nS increments.Bits 10-8 provide a fine position
  505. control in 35nS increments.
  506.  
  507.     BIT#    FUNCTION   DESCRIPTION    (from C-18 AGA doc)
  508.     ----    --------   -----------
  509.      15-11  x          (unused)
  510.      10     H1         140nS
  511.      09     H1         70nS
  512.      08     H0         35nS
  513.      07     H10        35840nS
  514.      06     H9         17920nS
  515.      05     H8         8960nS
  516.      04     H7         4480nS
  517.      03     H6         2240nS
  518.      02     H5         1120nS
  519.      01     H4         560nS
  520.      00     H3         280nS
  521.  
  522.                 *
  523.  
  524. vtotal        EQU   $1c8        ;  Highest numbered vertical line
  525.                 ; (VARBEAMEN bit in BEAMCON0 must be set)
  526.  
  527.    VTOTAL    W   A     Highest numbered vertical line
  528.  
  529. VTOTAL contains the line number at which to reset the vertical position
  530. counter.  This value represents the number of lines in a field(+1). The
  531. exception is if the INTERLACE bit is set (BPLCON0). In this case this
  532. value represents the number of lines in the long field (+2) and the number
  533. of lines in the short field (+1).
  534.  
  535.                 *
  536.  
  537. vsstop        EQU   $1ca        ;  Vertical line position for VSYNC stop
  538.  
  539.                 *
  540.  
  541. vbstrt        EQU   $1cc        ;  Vertical line for VBLANK start
  542. vbstop        EQU   $1ce        ;  Vertical line for VBLANK stop
  543.  
  544. (V10-0 <- D10-0) Affects CSY pin if BLAKEN=1 and VSY pin if CSCBEN=1 (BEAMCON0)
  545.  
  546.                 *
  547.  
  548. sprhstrt    EQU   $1d0        ;UHRES sprite vertical displat start
  549.  
  550.  BIT#  15  14  13  12  11  10  09  08     07  06  05  04  03  02  01  00
  551.         x   x   x   x   x  v10 v9  v8     v7  v6  v5  v4  v3  v2  v1  v0
  552.  
  553.                 *
  554.  
  555. sprhstop    EQU   $1d2        ;UHRES sprite vertical display stop
  556.  
  557.     BIT#  15  14  13  12  11  10  09  08     07  06  05  04  03  02  01  00
  558. SPRHWRM   x   x   x   x   x  v10  v9  v8     v7  v6  v5  v4  v3  v2  v1  v0
  559.  
  560.     SPRHWRM = Swaps the polarity of ARW* when the SPRHDAT comes
  561.     out so that external devices can detect the RGA and put
  562.     things into memory.(ECS and later chips only)
  563.  
  564.                 *
  565.  
  566. bplhstrt    EQU   $1d4        ;UHRES bit plane vertical start
  567.  
  568.             This controls the line when the data fetch starts for
  569.             the BPLHPTH,L pointers. V10-V0 on DB10-0.
  570.  
  571.                 *
  572.  
  573. bplhstop    EQU   $1d6        ;UHRES bit plane vertical stop
  574.  
  575.             BIT#   name
  576.             ----   ----
  577.             15     BPLHWRM
  578.             14-11  Unused
  579.             10-0   V10-V0
  580.  
  581. BPLHWRM = Swaps the polarity of ARW* when the BPLHDAT comes out so that
  582. external devices can detect the RGA and put things into memory (from ECS)
  583.  
  584.                 *
  585.  
  586. hhposw        EQU   $1d8        ;DUAL mode hires H beam counter write
  587. hhposr        EQU   $1da        ;DUAL mode hires H beam counter read
  588.  
  589. This the secondary beam counter for the faster mode, triggering the UHRES
  590. pointers & doing the comparisons for HBSTRT,STOP,HTOTAL,HSSRT,HSSTOP
  591. (See HTOTAL for bits)
  592.  
  593.                 *
  594.  
  595. beamcon0    EQU   $1dc        ; Beam counter control register (ECS)
  596.                 ; (SHRES,UHRES,PAL)
  597.     15    -
  598.     14 ECS    HARDDIS        Disable Hardwired vert/hor blank
  599.     13 ECS    LPENDIS        Ignore latched pen value on vert pos read
  600.     12 ECS    VARVBEN        Variable vertical blank enable
  601.                 Use VBSTRT/STOP disable hard window stop
  602.     11 ECS    LOLDIS        Disable longline/shortline toggle
  603.     10 ECS    CSCBEN        Composite sync redirection
  604.     09 ECS    VARVSYEN    Variable vertical sync enable
  605.     08 ECS    VARHSYEN    Variable horizontal sync enable
  606.     07 ECS    VARBEAMEN    Variable beam counter comparator enable
  607.     06 ECS    DISPLAYDUAL    Special ultra resolution enable
  608.                 (use UHRES pointer and standard pointers)
  609.     05 ECS    DISPLAYPAL    Programmable PAL mode enable (pal/ntsc switch)
  610.     04 ECS    VARCSYEN    Variable composite sync enable
  611.     03 ECS    BLANKEN-CSBLANK    Composite blank redirection (out to CSY pin)
  612.     02 ECS    CSYNCTRUE    Polarity control for Composite sync pin (TRUE)
  613.     01 ECS    VSYNCTRUE    Polarity control for Vertical sync pin (TRUE)
  614.     00 ECS    HSYNCTRUE    Polarity control for Horiz sync pin (TRUE)
  615.  
  616.     (From C-18 AGA DOC)
  617.  
  618. HARDDIS = This bit is used to disable the hardwire vertical horizontal
  619.           window limits. It is cleared upon reset.
  620.  
  621. LPENDIS = When this bit is a low and LPE (BPLCON0,BIT 3) is enabled, the
  622.           light-pen latched value(beam hit position) will be read by
  623.           VHPOSR,VPOSR and HHPOSR. When the bit is a high the light-pen
  624.           latched value is ignored and the actual beam counter position is
  625.           read by  VHPOSR,VPOSR, and HHPOSR.
  626.  
  627. VARVBEN = Use the comparator generated vertical blank (from VBSTRT,VBSTOP)
  628.           to run the internal chip stuff-sending RGA signals to Denise,
  629.           starting sprites,resetting light pen. It also disables the hard
  630.           stop on the vertical display window.
  631.  
  632. LOLDIS  = Disable long line/short toggle. This is useful for DUAL mode
  633.           where even multiples are wanted, or in any single display
  634.           where this toggling is not desired.
  635.  
  636. CSCBEN  = The variable composite sync comes out on the HSY pin, and the
  637.           variable conosite blank comes out on the VSY pin. The idea is
  638.           to allow all the information to come out of the chip for a
  639.           DUAL mode display. The normal monitor uses the normal composite
  640.           sync, and the variable composite sync &blank come out the HSY &
  641.           VSY pins. The bits VARVSTEN & VARHSYEN (below) have priority over
  642.           this control bit.
  643.  
  644. VARVSYEN= Comparator VSY -> VSY pin. The variable VSY is set vertically on
  645.           VSSTRT, reset vertically on VSSTOP, with the horizontal position
  646.           for set set & reset HSSTRT on short fields (all fields are short
  647.           if LACE = 0) and HCENTER on long fields (every other field if
  648.           LACE = 1).
  649.  
  650. VARHSYEN= Comparator HSY -> HSY pin. Set on HSSTRT value, reset on HSSTOP
  651.           value.
  652.  
  653. VARBEAMEN=Enables the variable beam counter comparators to operate
  654.           (allowing diffrent beam counter total values) on the main horiz
  655.           counter. It also disables hard display stops on both horizontal
  656.           and vertical.
  657.  
  658. DUAL    = Run the horizontal comparators with the alternate horizontal beam
  659.           counter, and starts the UHRES pointer chain with the reset of
  660.           this counter rather than the normal one. This allows the UHRES
  661.           pointers to come out more than once in a horizontal line,
  662.           assuming there is some memory bandwidth left (it doesn`t work in
  663.           640*400*4 interlace mode) also, to keep the two displays synced,
  664.           the horizontal line lentghs should be multiples of each other.
  665.           If you are amazingly clever, you might not need to do this.
  666.  
  667. PAL     = Set appropriate decodes (in normal mode) for PAL. In variable
  668.           beam counter mode this bit disables the long line/short line
  669.           toggle- ends up short line.
  670.  
  671. VARCSYEN= Enables CSY from the variable decoders to come out the CSY
  672.           (VARCSY is set on HSSTRT match always, and also on HCENTER
  673.           match when in vertical sync. It is reset on HSSTOP match when VSY
  674.           and on both HBSTRT &HBSTOP matches during VSY. A reasonable
  675.           composite can be generated by setting HCENTER half a horiz line
  676.           from HSSTRT, and HBSTOP at (HSSTOP-HSSTRT) before HCENTER, with
  677.           HBSTRT at (HSSTOP-HSSTRT) before .... see below
  678.  
  679.                 *
  680.  
  681. HSSTRT        EQU   $1DE        ; Horizontal sync start (VARHSY)
  682.         Sets # of colour clocks for sync start (HTOTAL for bits)
  683.         See BEAMCON0 for details of when these 2 are active.
  684.  
  685.                 *
  686.  
  687. vsstrt        EQU   $1e0        ;  Vertical sync start (VARVSY)
  688.                 ; (VARVSYEN bit in BEAMCON0 must be set)
  689.  
  690.                 *
  691.  
  692. hcenter     EQU   $1e2        ;  Horizontal position for VSynch on interlace
  693.                 ;  (or CCKs on long field)
  694.  
  695. this is necessary for interlace mode with variable beam counters.
  696. See BEAMCON0 for when it affects chip outputs. See HTOTAL for bits.
  697.  
  698.                 *
  699.  
  700. diwhigh     EQU   $1e4    ; highest bits for the diwstrt/stop
  701.  
  702. DIWHIGH is reset by writes to DIWSTRT or DIWSTOP. This interlock is inherited
  703. from ECS Denise.
  704.  
  705. Display window upper bits for start, stop this is an added register for Hires
  706. chips, and allows larger start & stop ranges. If it is not written, the above
  707. (DIWSTRT,STOP) description holds. If this register is written, direct start &
  708. stop positions anywhere on the screen. It doesn`t affect the UHRES pointers.
  709.  
  710.     BIT# 15  14  13  12  11  10  09  08  07  06  05  04  03  02  01  00
  711.           X   X  H10 H1  H0  V10 V9  V8   X   X  H10 H1  H0  V10 V9  V8
  712.             (stop)            |        (start)
  713.  
  714. Take care (X) bits should always be written to 0 to maintain upwards
  715. compatibility. H1 and H0 values define 70ns amd 35ns increments respectively,
  716. and new LISA bits.
  717.  
  718. NOTE:    In all 3 display window registers, horizontal bit
  719.     positions have been renamed to reflect HIRES pixel increments, e.g.
  720.     what used to be called H0 is now referred to as H2.
  721.  
  722.                 *
  723.  
  724. BPLHMOD     EQU   $1E6        ; modulo of the bitplane of UHRES
  725.         ;This is the number (sign extended) that is added to the
  726.         ;UHRES bit plane pointer (BPLHPTL,H) every line, and
  727.         ;then another 2 is added, just like the other modulos.
  728.  
  729.                 *
  730.  
  731. SPRHPTH     EQU   $1E8        ; sprite pointer for UHRES (high 5 bits)
  732. SPRHPTL     EQU      $1EA        ; sprite pointer for UHRES (low 15 bits)
  733.  
  734. This pointer is activated in the 1st and 3rd `free` cycles (see BPLHPTH,L)
  735. after horiz line start.It increments for the next line.
  736.  
  737.                 *
  738.  
  739. BPL1HPTH    EQU      $1EC        ; VRAM BITPLANE POINTER FOR UHRES (high 5 bits)
  740.  
  741.  
  742.                 *
  743.  
  744. BPL1HPTL    EQU      $1EE        ; VRAM BITPLANE POINTER FOR UHRES (low 15 bits)
  745.  
  746.         When UHRES is enabled, this pointer comes out on the
  747.         2nd 'free' cycle after the start of each horizontal
  748.         line. It`s modulo is added every time it comes out.
  749.         'free' means priority above the copper and below the
  750.         fixed stuff (audio,sprites....).
  751.         BPLHDAT comes out as an identifier on the RGA lines when
  752.         the pointer address is valid so that external detectors
  753.         can use this to do the special cycle for the VRAMs, The
  754.         SHRHDAT gets the first and third free cycles.
  755.  
  756.                 *
  757.  
  758. fmode        EQU   $1fc    ; 0  = BPL32 - bitplane 32 bit wide mode
  759.             ; 1  = BPAGEM - bitplane page mode (double cas)
  760.                   (REMEMBER to align 32 or 64 bits the bitplanes)
  761.             ; 2  = SPR32 -sprite 32 bit wide mode
  762.             ; 3  = SPAGEM -sprite page mode (double cas)
  763.                   (REMEMBER to align 32 or 64 bits the sprite)
  764.             ; 4-13 = UNUSED
  765.             ; 14 = BSCAN2 enabled use of 2nd P/F modulus on an
  766.             ;      alternate line basis to suppott bitplane scan
  767.                    doubling! (probably for fancy monitors!)
  768.             ; 15 = SSCAN2, global enable for sprite scan doubling
  769.  
  770.     BPAGEM BPL32 Bitplane Fetch Increment Memory Cycle Bus Width
  771.     ------------------------------------------------------------
  772.       0    0    By 2 bytes    (as before) normal CAS     16
  773.       0    1    By 4 bytes            normal CAS     32
  774.       1    0    By 4 bytes            double CAS     16
  775.       1     1    By 8 bytes                 double CAS 32
  776.  
  777.     SPAGEM SPR32 Sprite Fetch Increment  Memory Cycle  Bus Width
  778.     ------------------------------------------------------------
  779.       0     0    By 2 bytes    (as before) normal CAS     16
  780.       0     1    By 4 bytes                normal CAS     32
  781.       1     0    By 4 bytes                double CAS     16
  782.       1     1    By 8 bytes                double CAS     32
  783.  
  784. SSCAN2 bit in FMODE enables sprite scan-doubling. When enabled, individual
  785. SH10 bits in SPRxPOS registers control whether or not a given sprite is to
  786. be scan-doubled. When V0 bit of SPRxPOS register matches V0 bit of vertical
  787. beam counter, the given sprite's DMA is disabled and LISA reuses the sprite
  788. data from the previous line. When sprites are scan-doubled, only the
  789. position and control registers need be modified by the programmer; the data
  790. registers need no modification.
  791.  
  792. NOTE: Sprite vertical start and stop positions must be of the same parity,
  793. i.e. both odd or both even.
  794.  
  795. For non-interlaced screens, bitplane scandoubling is enabled (bit 14 BSCAN2
  796. in FMODE) This repeats each scanline twice. A side effect of this is that the
  797. bitplane modulos are unavailable for user control.
  798.  
  799. BSCAN bit 14 in FMODE enables bitplane scan-doubling. When V0 bit of DIWSTRT
  800. matches V0 of vertical beam counter, BPL1MOD contains the modulus for the
  801. display line, else BPLMOD is used. When scan-doubled both odd and even
  802. bitplanes use the same modulus on a given line, whereas in normal mode
  803. odd bitplanes used BPL1MOD and even bitplanes used BPL2MOD. As a result
  804. Dual Playfield screens will probably not display correctly when scan-doubled.
  805.  
  806. DDFSTRT  and  DDFSTOP values should be modified if you change
  807. the burst mode.    (From YRAGAEL & JUNKIE doc)
  808.  
  809.  Eg:  If  you  use  LONG  burst  mode  to open an Hires screen
  810.      starting   at   hardware   horizontal   position  STARTX:
  811.      DDFSTRT=(STARTX-17)/2 and no more DDFSTRT=(STARTX-9)/2
  812.  
  813. Why  ?   Very  easy.  You need 4 cycles to read a word (using all  the
  814. bitplanes) in Hires.  If you want the image to start at  STARTX,  you  must
  815. read the first word 4 cycles before its horizontal  position.   Add  0.5
  816. cycles (it's needed !).  This gives  DDFSTRT=(STARTX-9)/2.   If  you are in
  817. LONG burst mode, then  you  will read a long.  This will take 8 cycles.
  818. So you must  read  the  first  long  8.5  cycles  before  the  STARTX
  819. position:  DDFSTRT=(STARTX-17)/2.  That's all.
  820.  
  821. - The Magic FMode Register (from howtocode6.txt)
  822.  
  823. If you set your 1200/4000 to a hiresmode (such as 1280x512 Superhires
  824. 256 colours) and disassemble the copperlist, you find fun things
  825. happen to the FMODE register ($dff1fc). The FMODE register determines
  826. the amount of words transferred between chipram and the Lisa chip
  827. in each data fetch. NOTE: Using a data fetch > 0 in standard LOWRES or
  828. in hires resolutions, the COPPERLIST will be faster (will leave free
  829. more time for the 680x0 and blitter), but the BLITTER speed is the SAME.
  830.  
  831. $dff1fc bits 0 and 1 value
  832.  
  833. $00 - Normal (word aligned bitmaps) - for standard ECS modes
  834.       and up to 8 bitplanes 320x256
  835.  
  836. $01 - Double (longword aligned bitmaps) - for 640x256 modes in
  837.       more than 16 colours
  838.  
  839. $10 - Double (longword aligned bitmaps) - Same effect, for 640x256 modes
  840.       but different things happen... Not sure why!
  841.  
  842. $11 - Quadruple [x4] (64-bit aligned bitmaps) - for 1280x256 modes...
  843.  
  844. - Fetch Mode Required for Displays
  845.  
  846. *ALL* ECS and lower screenmodes require only 1x datafetch. All modes
  847. run *FASTER* with at least 2x bandwidth, so try and use 2x bandwitdh
  848. if possible.
  849.  
  850. Bits 2 and 3 do the same for sprite width, as has been mentioned elsewhere...
  851.  
  852. Remember... To take advantage of the increased fetchmodes (which give
  853. you more processor time to play with!) your bitmaps must be on 64-bit
  854. boundaries and be multiples of 64-bits wide (8 bytes)
  855.  
  856. * New for AA ChipSet (V39)
  857.                 - $DFF100 -
  858.  HIRES HAM        :    %1000100000000000 - LACE: %1000100000000100
  859.  SUPERHIRES HAM        :    %1000100001000000 - LACE: %1000100001000100
  860.  (is possible to do hires and superhires EHB)
  861.  
  862.                 *
  863.  
  864. Bitplanes:
  865. Set 0 to 7 bitplanes as before in $dff100.
  866. Set 8 bitplanes by setting bit 4 of $dff100, bits 12 to 15 should be zero.
  867. For Hires when you have 8 bitplanes remember to set the bit 0 and 1 of $dff1fc
  868.  
  869. 8 bitplanes:
  870.  
  871.  The  number of bitplanes used to be specify with bits 14 to 12 of register
  872. $DFF0100.   Since  there were just 3 bits, it would have been impossible to
  873. use more than 7 bitplanes.
  874.  
  875.  To  use  8  bitplanes, switch bit 4 of register $DFF100.  Don't forget to
  876. clear bits 14 to 12 for further compatiblity :).
  877.  
  878. bit 4 | 8 bitplanes mode
  879. ------------------------
  880.   0   | Not Selected
  881. ------------------------
  882.   1   | Selected
  883. ------------------------
  884.  
  885. Using 64-colour mode (NOT extra halfbrite) requires setting the
  886. KILLEHB (bit 9) in BPLCON2.
  887.  
  888.                 *
  889.  
  890. Colour Registers:
  891.  
  892. There are now 256 colour registers, all accessed through the original
  893. 32 registers
  894.  
  895. AGA works with 8 differents palettes of 32 colors each, re-using
  896. colour registers from $0180 to $01BE.
  897.  
  898. You can choose the palette you want to access via the bits 13 to 15 of
  899. register $0106
  900.  
  901.  
  902. bit 15 | bit 14 | bit 13 | Selected palette
  903. -------+--------+--------+------------------------------
  904.    0   |    0   |    0   | Palette 0 (color 0 to 31)
  905.    0   |    0   |    1   | Palette 1 (color 32 to 63)
  906.    0   |    1   |    0   | Palette 2 (color 64 to 95)
  907.    0   |    1   |    1   | Palette 3 (color 96 to 127)
  908.    1   |    0   |    0   | Palette 4 (color 128 to 159)
  909.    1   |    0   |    1   | Palette 5 (color 160 to 191)
  910.    1   |    1   |    0   | Palette 6 (color 192 to 223)
  911.    1   |    1   |    1   | Palette 7 (color 224 to 255)
  912.  
  913.                 *
  914.  
  915. To move a 24-bit colour value into a colour register requires
  916. two writes to the register:
  917.  
  918. First clear bit 9 of $dff106
  919. Move high nibbles of each colour component to colour registers
  920.  
  921. Then set bit 9 of $dff106
  922. Move low nibbles of each colour components to colour registers
  923.  
  924. bit 9 | Access
  925. ------------------------------------------------
  926.   0   | Access to 4 high bits of R,G,B components
  927. ------------------------------------------------
  928.   1   | Access to 4 low bits of R,G,B components
  929. ------------------------------------------------
  930.  
  931.  You  must respect the order:  first move the 3*4 HIGH bits and then the 3*4
  932.  LOW bits !
  933.